package com.biz.primus.ms.member.dao.po;

import com.biz.primus.model.member.enums.SymbolTypes;
import com.biz.primus.ms.base.jpa.po.BaseEntityPKIncrement;
import lombok.Data;
import lombok.EqualsAndHashCode;

import javax.persistence.*;
import java.math.BigDecimal;

/**
 * 会员rfm分组规则
 * @author jun.liu
 * @date 2017年10月22日
 * @reviewer
 * @see
 */
@Entity
@Table(name = "member_group_rfm_rule")
@Data
@EqualsAndHashCode(callSuper = true)
public class MemberGroupRFMRule extends BaseEntityPKIncrement
{

    /**
     * 名称
     */
    @Column(name = "name", length = 32, nullable = false, unique = true)
    private String name;

    /**
     * 最近消费时间 符号类型
     */
    @Convert(converter = SymbolTypes.Converter.class)
    @Column
    private SymbolTypes recencySymbolType;

    /**
     * 最近消费时间（月份数量）
     */
    @Column
    private Integer recency;

    /**
     * 消费频次 符号类型
     */
    @Convert(converter = SymbolTypes.Converter.class)
    @Column
    private SymbolTypes frequencySymbolType;

    /**
     * 消费频次
     */
    @Column
    private Integer frequency;

    /**
     * 消费金额 符号类型
     */
    @Convert(converter = SymbolTypes.Converter.class)
    @Column
    private SymbolTypes monetarySymbolType;

    /**
     * 消费金额
     */
    @Column(columnDefinition = "DECIMAL(9,2)")
    private BigDecimal monetary;

}
